#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QPen>
#include <QTableWidget>
#include "qcustomplot.h"
#include <QTimer>

namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    bool event(QEvent *mEvent);
    void plotFunc(QVector<double>& x,  QVector<double>& y, QPen color = QPen(Qt::blue));
    void plotFunc2(QVector<double>& x,  QVector<double>& y, QPen color = QPen(Qt::blue));
    void plotFunc3(QVector<double>& x,  QVector<double>& y, QPen color = QPen(Qt::blue));

    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();

private slots:

    void on_pushButton_3_clicked();

    void on_pushButton_loadValues_clicked();

private:
    double countFunc (double x, int type=0);
    double countIntegral (double a, double b, int type, int method, int n);
    double countAdopted(double a, double b, int method, double eps=1e-4);

    Ui::MainWindow *ui;
    QCustomPlot* difference;

    QCustomPlot* g_x;
    double alpha;
    double t;
    int nOperations;
    int nEnteringIntegral;
};

#endif // MAINWINDOW_H
